﻿using LD.Host;
using System;

namespace LD.Tool
{
    public partial class ToolFpcFrm : FrmToolBaseSkip
    {
        public ToolFpcFrm()
        {
            InitializeComponent();
            this.Shown += ToolMesSharpFrm_Shown;
            this.btn_ok.Click += Btn_ok_Click;
        }

        private void ToolMesSharpFrm_Shown(object sender, EventArgs e)
        {
            Init();
        }

        private void Init()
        {
            foreach (var item in Cache.Var)
            {
                this.cob_cache.Items.Add(item.Name);
            }

            if (TB_Tool.Param != null)
            {
                this.cob_cache.Text = TB_Tool.Param;
            }
        }

        private void Btn_ok_Click(object sender, EventArgs e)
        {
            TB_Tool.Param = this.cob_cache.Text;
        }
    }
}
